import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
// 路由表
const routes = [{
  path: '/login',
  name: 'login',
  component: () => import('@/views/login/')
},
{
  path: '/',
  component: () => import('@/views/layout/'),
  children: [{
    path: '/', // 默认子路由
    name: 'home', // 首页路由
    component: () => import('@/views/home/')
  },
  {
    path: '/message', // 默认子路由
    name: 'message', // 信息页面路由
    component: () => import('@/views/message/')
  },
  {
    path: '/function', // 默认子路由
    name: 'function', // 功能页面路由
    component: () => import('@/views/function/')
  },
  {
    path: '/mine', // 默认子路由
    name: 'mine', // 我的页面路由
    component: () => import('@/views/mine/')
  }]
}
]

const router = new VueRouter({
  routes
})

export default router
